###
#	Name: Remove All Blocked File Extensions from a Default SharePoint Web Application
#	Created By: Nate Bruneau (nathbr)
#	Date: 6/16/2010
###

#bug #fix for multiple web applications
$webapps = get-spwebapplication |% { $_.Url }

	foreach ($webapp in $webapps){
	Write-Host -ForegroundColor Yellow "Removing Blocked File Extension for $webapp. "
	$wa = Get-SPWebApplication $webapp

	$blockFileExs = $wa.BlockedFileExtensions
	$list = @()

		foreach ($fileEx in $blockFileExs){
		Write-Host -ForegroundColor Yellow "Removing Blocked File Extension: $fileEx"
		$list += $fileEx
		}

		foreach ($item in $list){
			$blockFileExs.Remove("$item")

		}

	$wa.Update()
	Write-Host -ForegroundColor Yellow "Removing Blocked File Extension for $webapp. COMPLETED "
	}